package com.example.springboot0811.controller;

import com.example.springboot0811.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.PostConstruct;

@Controller
@ResponseBody
@RequestMapping("/user")
public class UserController {

//    @Value("${myobj.name}")
//    private String name;

    @Autowired
    private User user;

    @PostConstruct
    public void doPostConstruct() {
        System.out.println(user);
       // System.out.println("-----------name---->" + name);
    }
}
